package com.niu.wm.service;

import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;


import com.niu.wm.model.User;


public interface UserService extends UserDetailsService {
	
	//登录日志
	void loginLog(User user, String fromIP);
	
	void refrechCache();
	
	String getUserName(Long id);
	
    User load(Long id) ;
    
    User loadByAccount(String account);

	boolean add(User user);

    int update(User user);

    boolean changePwd(Long userId, String password);

    boolean isRegistered(String loginname);

    /**
     * 根据用户名获取用户信息-- spring-security 接口需要的方法
     */
    User loadUserByUsername(String loginname) throws UsernameNotFoundException;

    /**
     * 用户登陆
     * @param userName
     * @param userPwd
     * @return
     */
    User login(String userName, String userPwd);

}
